package structure.proxy.dynamicProxy;

import structure.proxy.dynamicProxy.daos.ProxyFactory;
import structure.proxy.dynamicProxy.daos.TeacherDao;
import structure.proxy.dynamicProxy.interfaces.ITeacherDao;

public class User {
    public static void main(String[] args) {
        // 创建目标对象
        ITeacherDao target = new TeacherDao();
        ITeacherDao proxyInstance =
                (ITeacherDao) new ProxyFactory(target).getProxyInstance();
        proxyInstance.teach("Math");
        System.out.println(proxyInstance.getClass());
    }
}
